package model;

import java.util.Map;
import tpInterface.ICart;

/**
 *
 * @author SonTT
 */
public class CartM implements ICart {

    private TPConnection tpConnection;

    public CartM() {
    }

//    @Override
//    public ProductDetail getProductDetailByProductID(String productID) {
//        String driveString = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
//        String url = "jdbc:sqlserver://localhost:1433; databasename=tech-pro";
//        String username = "sa";
//        String password = "fat123456";
//        
//        ProductDetail p = null;
//
//        try {
//            Class.forName(driveString);
//            Connection connection = DriverManager.getConnection(url, username, password);
//            Statement stm = connection.createStatement();
//            String query = "SELECT"
//                    + " Product.ProductID,"
//                    + " Product.ProductName,"
//                    + " Producer.ProducerName,"
//                    + " Category.CategoryName,"
//                    + " Image.Path,"
//                    + " Product.Description,"
//                    + " Product.Price,"
//                    + " Product.Quantity,"
//                    + " Product.Activated,"
//                    + " Product.Deleted,"
//                    + " Product.ModifiedDate"
//                    + " FROM Product"
//                    + " INNER JOIN Producer ON Product.ProducerID = Producer.ProducerID"
//                    + " INNER JOIN Category ON Product.CategoryID = Category.CategoryID"
//                    + " INNER JOIN Image ON Product.ImageID = Image.ImageID"
//                    + " WHERE Product.Deleted = 0 AND ProductID=" + productID;
//
//            ResultSet rs = stm.executeQuery(query);
//
//            if (rs.wasNull()) {
//                return null;
//            } else {
//                while (rs.next()) {
//                    p = new ProductDetail(
//                            rs.getByte(1),
//                            rs.getNString(2),
//                            rs.getNString(3),
//                            rs.getNString(4),
//                            rs.getNString(5),
//                            rs.getNString(6),
//                            rs.getFloat(7),
//                            rs.getInt(8),
//                            rs.getBoolean(9),
//                            rs.getBoolean(10),
//                            rs.getDate(11));
//                }
//
//                return p;
//            }
//        } catch (ClassNotFoundException ex) {
//            Logger.getLogger(ProductM.class.getName()).log(Level.SEVERE, null, ex);
//            return null;
//        } catch (SQLException ex) {
//            Logger.getLogger(ProductM.class.getName()).log(Level.SEVERE, null, ex);
//            return null;
//        }
//    }
//    private static final Logger LOG = Logger.getLogger(CartM.class.getName());

    @Override
    public Map<String, Integer> getCart() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public String addCart(String productID) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public String editCart(Map<String, Integer> newCart) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public String removeCart() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public String resetCart() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
